import { createRouter, createWebHistory } from "vue-router"
import DefinePrivilege from '../views/DefinePrivilege.vue'
import ShowPrivilege from '../views/ShowPrivilege.vue'
import HomeView from "../views/HomeView.vue"
import LoginVue from "../views/LoginVue.vue"
import RegisterVue from "../views/RegisterVue.vue"

const router = createRouter({
  history: createWebHistory(),
  routes: [
    {
      path: "/",
      name: "login",
      component: LoginVue,
    },
    {
      path: "/register",
      name: "register",
      component: RegisterVue,
    },
    {
      path: "/home",
      name: "home",
      component: HomeView,
      children: [
        {
          path: "/privilege",
          component: DefinePrivilege,
          name: "definePrivilege"
        },
        {
          path: "/show",
          component: ShowPrivilege,
          name: "showPrivilege"
        }
      ]
    },
  ],
});

export default router;
